<%@ page language="java" contentType="text/html;charset=utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<html lang="zh-cn" class="no-js">
<!--<![endif]-->
<style type="text/css">

	    
	    .delete2 {
      display: block;
      color: white;

      width: 20px;
      height: 20px;
      top: 0;
      right: 13px;
      position: absolute;
      text-align: center;
      line-height: 20px; }  
</style>
<head>
<jsp:include page="../common/common.jsp" />
<link rel="stylesheet" type="text/css"
	href="${path}/assets/plugins/select2/select2.css" />
<link rel="stylesheet" type="text/css"
	href="${path}/assets/plugins/select2/select2-metronic.css" />
</head>
<body class="page-header-fixed">
<script type="text/javascript" src="${path }/layer/layer.js"></script>
	<jsp:include page="../common/header.jsp" />
	<div class="clearfix"></div>
	<div class="page-container">
		<div class="page-sidebar-wrapper"><jsp:include
				page="../common/menu.jsp" /></div>
		<div class="page-content-wrapper">
			<div class="page-content">
				<div class="row">
					<div class="col-md-12">
						<div class="portlet box purple">
							<div class="portlet-title">
								<div class="caption">
									<i class="fa fa-file-text-o"></i> 数据列表
								</div>
								<div class="tools">
									<div class="actions"><span style="color: red;">注：如果只添加一条秘钥，并且未绑定微信id代表是单一秘钥，反之是多秘钥</span>
								  <a href="#"    id="exportExcel"  class="btn green">
								  <i class="fa fa-plus"> 导出Excel</i></a>
										
										<a href="${path}/secretkeyl/edit?liveId=${liveId}" class="btn green"><i
											class="fa fa-plus"> 新增</i></a>
											
											<a href="#" class="btn green"   onclick="opendic()"><i
											class="fa fa-plus"> 批量生成秘钥 </i></a>
											
											
									</div>
								</div>
							</div>
							<div class="portlet-body">
								<form id="formQuery" class="form-horizontal"
									action="${path}/evaluationProject/list">
									  <input type="hidden" id="liveId" name="liveId" value="${liveId}">
									<div class="form-body">
										<div class="form-group">
											<label class="col-md-1 control-label">昵称</label>
											<div class="col-md-2">
												<input type="text" class="form-control" id="userNickName"
													name="userNickName" />
											</div>
									
											<label class="col-md-1 control-label">创建时间</label>
											<div class="col-md-4">
												<div
													class="input-group input-large date-picker input-daterange"
													data-date-format="yyyy-mm-dd">
													<input type="text" class="form-control" id="fromDate"
														name="fromDate" value="${fromDate}" readonly="readonly"
														onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" />
													<span class="input-group-addon">to</span> <input
														type="text" class="form-control" id="toDate" name="toDate"
														value="${toDate}" readonly="readonly"
														onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" />
												</div>
											
											</div>  
											           <div class="col-md-1"> 
												<button type="button" class="btn green"
													onclick="getsecretkeylList()">查询</button></div>  
											
										</div>


									</div>
								</form>
								<table class="table table-striped table-bordered table-hover"
									id="newsList"></table>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	
	<!-- ************遮罩层************** -->     
	<div id="dbajax-modal" class="modal fade bs-modal-lg" tabindex="-1" role="dialog"
                                 data-keyboard="false"  style="margin-top: 230px;width: 760px;margin-left: 450px">
                               
                     
                           
                                  <!--       <div class="modal-header">
                                            <button type="button" class="close" data-dismiss="modal"></button>
                                            <h4 class="modal-title">详细信息</h4>
                                        </div> -->
                                        <div class="modal-body" >
                                            <div class="row">
                                                <div class="col-md-8">
                                                    <div class="portlet box purple ">
                                                        <div class="portlet-title">
                                                            <div class="caption">
                                                                <i class="fa fa-reorder" ></i> 基本信息
                                                                <a class='delete2' href='#'  data-dismiss="modal">&times;</a>
                                                   
                                                            </div>
                                                        </div>
                                                        <div class="portlet-body form">
                                                            <form id="formDetail" class="form-horizontal">
                                                                <div class="form-body">
                                                                     <div class="form-group">
                                                                        <label class="col-md-3 control-label">生成数量：</label>

                                                                        <div class="col-md-8">
                                                                            <input type="text" id="sl"
                                                                                   name="sl"
                                                                                   class="form-control"   style="width: 40%;float: left;"/>
                                                                               
                                                               	 <button type="button" class="btn btn-primary"   style="float:right; " onclick="addmiyao()">确定</button>
                                                                        </div>
                                                                   </div>
                                                                </div>
                                                            </form>
                                                        </div>
                                                    </div>
                                                </div>
                                            
                                            </div>
                                        </div>
                                       <!--   <div class="modal-footer">
                                            <button type="button" class="btn default" data-dismiss="modal">关闭</button>
                                        </div>-->
                                    </div>
                          
    <div id="bgMaster" style="z-index: 100" onclick="Cancelpops()"></div>
    <!-- ************遮罩层************** -->
	<jsp:include page="../common/footer.jsp" />
	<script type="text/javascript"
		src="${path}/assets/plugins/calendar/WdatePicker.js"></script>
	<script type="text/javascript"
		src="${path}/assets/plugins/district/linkagesel-min.js"></script>
	<script type="text/javascript"
		src="${path}/secretKeyl/js/secretKeyl.js"></script>
	<script>
	var liveId ='${liveId}'; 
		var msg = '${msg}';
		var name = '${sessionScope.user.username}';
		$(function() {
			if (msg)
				App.bubble(200, msg);
 
			$("#fromDate").val('${fromDate}');
			$("#toDate").val('${toDate}');

			getsecretkeylList();
		});
		
		$("#exportExcel").click(function(){
			
			 location.href="${path}/secretkeyl/secretkeylQueryByPage?liveId="+${liveId};

		 });
		
		function opendic(){
			$('#dbajax-modal').modal('show');
		}
		
		function addmiyao(){
		var sz=	$("#sl").val();
			if(isNaN(sz)){ 
				alert("请输入整数");
			}else{
				if(sz<400){
					$.ajax({
						type : "get",
						url : _path + "/secretkeyl/saveSecretKeyls?liveId=" + liveId + "&sz="+sz,
						async : false,
						dataType : "json",
							async : false,
							error : function(request) {
								alert("连接错误！");
							},
							success : function(data) {
								  if(data.statusCode==200){
									  $('#dbajax-modal').modal('hide');
									  App.bubble(200, " 成功");
									  getsecretkeylList();
								  }else{
									  App.bubble(200, "异常");
								  }
							}
					});
				}else{
					alert("最多400条");
				}
			}
		}
	</script>
</body>
</html>